--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--

---@type BP_DefaultWeapon_C

local M = UnLua.Class("Core.Weapon.BP_WeaponBase")
local Screen = require "Screen"
local Debug = require "Debug"
local Const = require "Const"

function M:UserConstructionScript()
	self.Super.UserConstructionScript(self)
	self.InfiniteAmmo = true
	-- self.ProjectileClass = UE.UClass.Load("/Game/Tps/Weapon/BP_DefaultProjectile.BP_DefaultProjectile_C")
	self.MuzzleSocketName = "MuzzleFlashSocket"
	self.World = self:GetWorld()
	self.FireType = 1

	self.SkMesh:SetSkeletalMesh(LoadObject(Const.SSP_WeaponSKMesh))
  -- self.SkMesh:SetAnimClass(UE.UClass.Load(Const.SSP_AnimBP))
end

function M:PlayFireSound()
  UE.UGameplayStatics.SpawnSoundAttached(LoadObject(Const.Rifle_Whip), self:K2_GetRootComponent())
end

function M:PlayMuzzleEffect()
    UE.UGameplayStatics.SpawnEmitterAttached(LoadObject(Const.P_AssaultRifle_MuzzleFlash), self.SkMesh, "MuzzleFlashSocket")
end

function M:PlayImpactEffect(Hit)
  UE.UGameplayStatics.SpawnEmitterAtLocation(self:GetWorld(), LoadObject(Const.P_Impact), Hit.ImpactPoint);
end

function M:PlayImpactSound(HitResult)
  -- Debug.PrintActorName(HitResult.Actor)
end

return M
